﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="Devices.aspx.cs" Inherits="Admin_Devices" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../Styles/ContactSubmit.css" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <div style="font-size:x-large;text-align:left">Devices</div>
    <div style="text-align: left; width: 100%">
        <asp:GridView ID="grdDevices" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" 
            BorderWidth="1px" CellPadding="3" Width="98%" ShowHeaderWhenEmpty="true"
            OnRowCommand="grdDevices_RowCommand" EmptyDataText="No Device">
            <Columns>                
                <asp:BoundField DataField="Name" HeaderText="Name" />
                <asp:BoundField DataField="CPU" HeaderText="CPU" />
                <asp:BoundField DataField="RAM" HeaderText="RAM" />
                <asp:BoundField DataField="DiskQuota" HeaderText="DiskQuota" />                
                <asp:BoundField DataField="Bandwidth" HeaderText="Bandwidth" />

                <asp:TemplateField>
                    <HeaderTemplate>OS</HeaderTemplate>
                    <ItemTemplate>
                        <%# Eval("OS.Name") %>
                    </ItemTemplate>                    
                </asp:TemplateField>

                <asp:BoundField HeaderText="IP Address" DataField="IP" />
                <asp:BoundField DataField="Fee" HeaderText="Fee" />

                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="btnEdit" runat="server" CommandArgument='<%#Eval("Id") %>' CommandName="EditDevice" Text="Edit"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandArgument='<%#Eval("Id") %>' CommandName="DeleteDevice" Text="Delete" 
                            onclientclick="return confirm('Are you sure you want to delete?')"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>
    </div>
    <br />
    <div style="text-align: left;">
        <asp:LinkButton ID="btnAddDevice" runat="server" Text="Add Device" onclick="btnAddDevice_Click" ></asp:LinkButton>
    </div>
</asp:Content>